package com.imooc.rabbit.api;

import com.imooc.rabbit.api.exception.MessageRunTimeException;

import java.util.List;

/**
 * @description: 生产者接口
 * @author: Yz
 * @create: 2020-10-09 15:28
 **/
public interface MessageProducer {

    /**
     * 消息的发送，附带SendCallBack回调执行响应的业务逻辑处理
     * @param message
     * @param sendCallBack
     * @throws MessageRunTimeException
     */
    void send(Message message,SendCallBack sendCallBack) throws MessageRunTimeException;

    /**
     * 消息的发送
     * @param message
     * @throws MessageRunTimeException
     */
    void send(Message message) throws MessageRunTimeException;

    /**
     * 消息的批量发送
     * @param messages
     * @throws MessageRunTimeException
     */
    void send(List<Message> messages) throws MessageRunTimeException;
}

